Skip to content

Add tooltips for the icons of the network modification table#3806

Merged
Mathieu-Deharbe merged 8 commits intomainfrom
tooltips-network-modif-panel
Mar 27, 2026
Merged

Add tooltips for the icons of the network modification table#3806
Mathieu-Deharbe merged 8 commits intomainfrom
tooltips-network-modif-panel

Conversation

@souissimai
Copy link
Copy Markdown
Contributor

@souissimai souissimai commented Mar 12, 2026

icons: trash, root network, drag and drop, description, activation, selection

Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
@Mathieu-Deharbe Mathieu-Deharbe self-requested a review March 18, 2026 15:10
Mathieu-Deharbe

This comment was marked as resolved.

Mathieu-Deharbe

This comment was marked as duplicate.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d389de9-f01e-44ff-93ab-7ae9e75dffc4

📥 Commits

Reviewing files that changed from the base of the PR and between af5053a and bff1626.

📒 Files selected for processing (1)
  • src/translations/fr.json

📝 Walkthrough

Walkthrough

Updated tooltip/i18n keys and tooltip wrappers across network-modification UI; refactored per-row cell rendering to apply drag-handle props to a nested span and added selection/drag tooltips; added corresponding English and French translation keys and small formatting edits.

Changes

Cohort / File(s) Summary
Node editor & small renderers
src/components/graph/menus/network-modifications/network-modification-node-editor.tsx, src/components/graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx, src/components/graph/menus/network-modifications/network-modification-table/renderers/switch-cell.tsx
Replaced generic tooltip/message ids with specific i18n keys (moveToTrash, addDescription, activateModification/deactivateModification); added FormattedMessage imports; description tooltip now falls back to addDescription; wrapped tooltip targets in spans where required.
Root network column
src/components/graph/menus/network-modifications/network-modification-table/columns-definition.tsx
Wrapped root-network eye Badge in an MUI Tooltip using visualizedRootNetwork with computed currentRootNetworkTag; added Tooltip and FormattedMessage imports.
Per-row rendering
src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
Refactored cell rendering to branch by column id; DRAG_HANDLE now applies provided.dragHandleProps to a nested <span> and shows moveModification tooltip; SELECT shows selectModification/deselectModification tooltip while preserving selection click behavior; added Tooltip and FormattedMessage imports.
Translations
src/translations/en.json, src/translations/fr.json
Removed enable/disable keys; added keys: moveToTrash, visualizedRootNetwork, addDescription, activateModification, deactivateModification, deselectModification, selectModification, moveModification; minor whitespace/formatting edits (commas/newline).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Row as ModificationRow
  participant DD as DragDropProvider
  participant Tooltip as MUI_Tooltip
  participant Store as Selection/State

  User->>Row: hover / click / drag handle
  Row->>Tooltip: request tooltip text (FormattedMessage)
  Row->>DD: attach provided.dragHandleProps to nested <span>
  Tooltip-->>User: display contextual message (move/select/visualizedRootNetwork)
  User->>Row: click selection/toggle
  Row->>Store: update selection/activation state
  Store-->>Row: updated state
  Row->>Tooltip: update tooltip message (select/deselect/activate/deactivate)
Loading

Suggested reviewers

  • TheMaskedTurtle
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding tooltips to icons in the network modification table.
Description check ✅ Passed The description lists the specific icons receiving tooltips (trash, root network, drag and drop, description, activation, selection), which directly relates to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx`:
- Line 63: The Tooltip currently uses the nullish coalescing operator with
description (Tooltip title={description ?? <FormattedMessage
id={'addDescription'} />}), which fails when description is an empty string;
change the check to a non-empty string test instead (e.g., use
description?.trim() or description && description.length) so that when
description is empty the fallback FormattedMessage ('addDescription') is shown;
update the Tooltip title expression and ensure it still references the same
description variable and the existing FormattedMessage id.

In
`@src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx`:
- Around line 50-55: Remove the temporary debug log inside the cell render loop:
eliminate the console.log(cellContent, 'pppp') that runs in the mapping over
row.getVisibleCells() (used with flexRender(cell.column.columnDef.cell,
cell.getContext())). Locate the map callback where row.getVisibleCells().map is
used and delete that console.log; if needed keep a conditional debug only behind
a dev-only flag or debugger statement rather than logging on every cell render
(especially for columns referenced via
BASE_MODIFICATION_TABLE_COLUMNS.DRAG_HANDLE and .SELECT).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5ffb7ceb-8106-482f-91d5-60ea31708a74

📥 Commits

Reviewing files that changed from the base of the PR and between a40f0f4 and 51624db.

📒 Files selected for processing (7)
  • src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/columns-definition.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/switch-cell.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
  • src/translations/en.json
  • src/translations/fr.json

Co-authored-by: Mathieu Deharbe <148252167+Mathieu-Deharbe@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as outdated.

Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Mathieu-Deharbe and others added 2 commits March 27, 2026 11:38
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
@Mathieu-Deharbe Mathieu-Deharbe changed the title add tooltips add tooltips for the icons of the network modification table Mar 27, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/translations/fr.json (2)

1718-1727: Inconsistent JSON formatting.

The new entries have formatting inconsistencies compared to the rest of the file:

  • Lines 1718, 1721-1723: Space before colon ( : should be :)
  • Line 1724: Space before comma (" ,)
  • Line 1726: Trailing space after the value
  • Line 1727: Leading space before closing brace
🧹 Proposed fix
-    "downloadNetworkModifications" : "Télécharger les modifications",
-    "moveToTrash": "Mettre à la corbeille",
-    "visualizedRootNetwork": "Réseau racine visualisé : {tag}",
-    "addDescription" : "Ajouter une description",
-    "activateModification" : "Activer la modification réseau",
-    "deactivateModification" : "Désactiver la modification réseau",
-    "deselectModification": "Désélectionner la modification" ,
-    "selectModification": "Sélectionner la modification",
-    "moveModification": "Déplacer la modification" 
- }
+    "downloadNetworkModifications": "Télécharger les modifications",
+    "moveToTrash": "Mettre à la corbeille",
+    "visualizedRootNetwork": "Réseau racine visualisé : {tag}",
+    "addDescription": "Ajouter une description",
+    "activateModification": "Activer la modification réseau",
+    "deactivateModification": "Désactiver la modification réseau",
+    "deselectModification": "Désélectionner la modification",
+    "selectModification": "Sélectionner la modification",
+    "moveModification": "Déplacer la modification"
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/translations/fr.json` around lines 1718 - 1727, The JSON entries for keys
"downloadNetworkModifications", "addDescription", "activateModification",
"deactivateModification", "deselectModification", "selectModification", and
"moveModification" have inconsistent spacing and stray whitespace; fix them to
match the file's standard JSON formatting by removing spaces before colons (use
":" not " :"), removing the extra space before the comma in
"deselectModification", trimming the trailing space after the "moveModification"
value, and removing the leading space before the closing brace so each key/value
pair follows the same "key": "value", pattern as the rest of the file.

11-11: Trailing whitespace after comma.

There's a trailing space after the comma on this line. Consider removing it for consistency.

🧹 Proposed fix
-    "filter": "Filtre", 
+    "filter": "Filtre",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/translations/fr.json` at line 11, Remove the trailing whitespace after
the comma in the JSON entry for the "filter" key so the line reads with no extra
space following the comma; locate the "filter": "Filtre", entry and delete the
trailing space to keep JSON formatting consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/translations/fr.json`:
- Around line 1718-1727: The JSON entries for keys
"downloadNetworkModifications", "addDescription", "activateModification",
"deactivateModification", "deselectModification", "selectModification", and
"moveModification" have inconsistent spacing and stray whitespace; fix them to
match the file's standard JSON formatting by removing spaces before colons (use
":" not " :"), removing the extra space before the comma in
"deselectModification", trimming the trailing space after the "moveModification"
value, and removing the leading space before the closing brace so each key/value
pair follows the same "key": "value", pattern as the rest of the file.
- Line 11: Remove the trailing whitespace after the comma in the JSON entry for
the "filter" key so the line reads with no extra space following the comma;
locate the "filter": "Filtre", entry and delete the trailing space to keep JSON
formatting consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6d826ea7-81ae-4739-a346-2de55c8d2619

📥 Commits

Reviewing files that changed from the base of the PR and between 331e804 and af5053a.

📒 Files selected for processing (4)
  • src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
  • src/translations/en.json
  • src/translations/fr.json
✅ Files skipped from review due to trivial changes (2)
  • src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/translations/en.json

@sBouzols sBouzols changed the title add tooltips for the icons of the network modification table Add tooltips for the icons of the network modification table Mar 27, 2026
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

@Mathieu-Deharbe Mathieu-Deharbe merged commit 93b5d95 into main Mar 27, 2026
6 checks passed
@Mathieu-Deharbe Mathieu-Deharbe deleted the tooltips-network-modif-panel branch March 27, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants